<div id="maincontent">
	<div id="content">
    
    
    
    
    
    
    <?php
    $class = "odd";
    ?>
    <div class="box1">
      <h3><?php echo lico_lang('recent', 'box1.page.title'); ?></h3>
        <div class="description"><?php echo lico_lang('recent', 'box1.page.description'); ?></div>
        <div class="infotable-line <?php echo $class; ?>">
          <ul class="infotable-ul">
            <li class="infotable-li col16p"><span><strong>Date</strong></span></li>
            <li class="infotable-li col08p"><span><strong>Number</strong></span></li>
            <li class="infotable-li col37p"><span><strong>Name</strong></span></li>
            <li class="infotable-li col30p"><span><strong>City</strong></span></li>
            <li class="infotable-li col08p"><span><strong>Country</strong></span></li>
          </ul>
        </div>
      <?php
      $sel = "SELECT *, UNIX_TIMESTAMP(f_ctime) AS ctime FROM `users` WHERE `state`=1 ORDER BY f_ctime DESC LIMIT 0,20";
      $ret = $db->getAll_assoc($sel);
      for ($a=0; $a<count($ret); $a++) {
        if ($class == "odd") { $class = "even"; } else { $class = "odd"; }
        
        $f_key = intval($ret[$a]['f_key']);
        $myregtime = lico_getdatetime(intval($ret[$a]['ctime']));
        $myemail = trim($ret[$a]['email']);
        $publishemail = trim($ret[$a]['privacy']);
        
        $select = "SELECT *, UNIX_TIMESTAMP(f_ctime), UNIX_TIMESTAMP(f_mtime) FROM `persons` WHERE `f_key`='".lico_ESC($f_key)."'";
        $seluser = $db->unbuffered_query_first($select);
        if (isset($seluser[0]) && intval($seluser[0]) >= 1) {
          //  f_key 	f_raw 	f_clean 	f_ctime 	f_mtime 	name 	placeid 	placesource 	city 	state 	country 	email 	homepage 	ident 	may_publish 	method 	started 	usage
          $myname = trim($seluser[5]);
          $mycity = trim($seluser[8]);
          $mystate = trim($seluser[9]);
          $mycountry = trim($seluser[10]);
          $publishinfo = trim($seluser[14]);
        }
        ?>
        <div class="infotable-line <?php echo $class; ?>">
          <ul class="infotable-ul">
            <li class="infotable-li col16p"><span><?php echo $myregtime; ?></span></li>
            <li class="infotable-li col08p"><span><a href="/user/<?php echo $f_key; ?>.html"><?php echo $f_key; ?></a></span></li>
            <li class="infotable-li col37p"><span><?php if ($publishinfo=="YES") { echo htmlspecialchars(stripslashes(trim($myname))); } else { echo "SECRET"; } ?></span></li>
            <li class="infotable-li col30p"><span><?php echo htmlspecialchars(stripslashes(trim($mycity))); ?></span></li>
            <li class="infotable-li col08p"><span><?php echo strtoupper(htmlspecialchars(stripslashes(trim($mycountry)))); ?></span></li>
          </ul>
        </div>
        <?php
      }
      // $select = "SELECT COUNT(m.f_key) AS num FROM `machines` m LEFT JOIN `users` u ON (u.`f_key`=m.`owner`) WHERE u.`state`=1 AND m.`isactive`='YES'";
      ?>
    </div>
    
    
    
    
    <?php
    $class = "odd";
    ?>
    <div class="box2">
      <h3><?php echo lico_lang('recent', 'box2.page.title'); ?></h3>
        <div class="description"><?php echo lico_lang('recent', 'box2.page.description'); ?></div>
        <div class="infotable-line <?php echo $class; ?>">
          <ul class="infotable-ul">
            <li class="infotable-li col16p"><span><strong>Date</strong></span></li>
            <li class="infotable-li col07p"><span><strong>Number</strong></span></li>
            <li class="infotable-li col07p"><span><strong>Owner</strong></span></li>
            <li class="infotable-li col32p"><span><strong>Hostname</strong></span></li>
            <li class="infotable-li col28p"><span><strong>CPU</strong></span></li>
            <li class="infotable-li col08p"><span><strong>Country</strong></span></li>
          </ul>
        </div>
      <?php
      $sel = "SELECT m.*, UNIX_TIMESTAMP(m.f_ctime) AS ctime FROM `machines` m LEFT JOIN `users` u ON (u.`f_key`=m.`owner`) WHERE u.`state`=1 AND m.`isactive`='YES' ORDER BY m.f_ctime DESC LIMIT 0,20";
      $ret = $db->getAll_assoc($sel);
      for ($a=0; $a<count($ret); $a++) {
        if ($class == "odd") { $class = "even"; } else { $class = "odd"; }
        
        $f_key = intval($ret[$a]['f_key']);
        $cpuid = intval($ret[$a]['cpu']);
        $hostname = trim($ret[$a]['name']);
        $owner = intval($ret[$a]['owner']);
        $myregtime = lico_getdatetime(intval($ret[$a]['ctime']));
        $myemail = trim($ret[$a]['email']);
        $publish_hostname = trim($ret[$a]['publish_hostname']);
        $publish_cpuinfo = trim($ret[$a]['publish_cpuinfo']);
        $country = trim($ret[$a]['country']);
        $cpu = "";
        
        if ($cpuid >= 1) {
          $select = "SELECT * FROM `processors` WHERE `f_key`='".lico_ESC($cpuid)."'";
          $seluser = $db->unbuffered_query_first($select);
          if (isset($seluser[0]) && intval($seluser[0]) >= 1) {
            //  f_key 	f_raw 	f_clean 	f_ctime 	f_mtime 	name 	placeid 	placesource 	city 	state 	country 	email 	homepage 	ident 	may_publish 	method 	started 	usage
            $cpu = trim($seluser[1]);
          }
        }
        ?>
        <div class="infotable-line <?php echo $class; ?>">
          <ul class="infotable-ul">
            <li class="infotable-li col16p"><span><?php echo $myregtime; ?></span></li>
            <li class="infotable-li col07p"><span><a href="/machine/<?php echo $f_key; ?>.html"><?php echo $f_key; ?></a></span></li>
            <li class="infotable-li col07p"><span><a href="/user/<?php echo $owner; ?>.html"><?php echo $owner; ?></a></span></li>
            <li class="infotable-li col32p"><span><?php if ($publish_hostname=="YES") { echo htmlspecialchars(stripslashes(trim($hostname))); } else { echo "SECRET"; } ?></span></li>
            <li class="infotable-li col28p"><span><?php if ($publish_cpuinfo=="YES") { echo htmlspecialchars(stripslashes(trim($cpu))); } else { echo "SECRET"; } ?></span></li>
            <li class="infotable-li col08p"><span><?php echo strtoupper(htmlspecialchars(stripslashes(trim($country)))); ?></span></li>
          </ul>
        </div>
        <?php
      }
      // $select = "SELECT COUNT(m.f_key) AS num FROM `machines` m LEFT JOIN `users` u ON (u.`f_key`=m.`owner`) WHERE u.`state`=1 AND m.`isactive`='YES'";
      ?>
    </div>
    
    
    
    
    
    
    
  </div>
</div>
